package com.bolt.admin.module.sys.controller;

import com.bolt.admin.module.sys.service.MonitorService;
import com.bolt.convention.data.ResultMessage;
import com.bolt.convention.data.Results;
import com.bolt.convention.data.Record;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/sys/monitor")
@RequiredArgsConstructor
@Api(tags = "服务监控管理")
public class MonitorController {

    private final MonitorService monitorService;

    @GetMapping
    @ApiOperation("查询服务监控")
    @RequiresPermissions("monitor:server")
    public ResultMessage info() {
        Record data = monitorService.getServers();
        return Results.success(data);
    }

}

 